/* 封装搜索相关的接口 */

import axios from '@/utils/request'

/**
 * 搜索联想
 * @param {*} q 搜索关键字
 */
export const getSuggest = (q) => {
  return axios({
    url: '/v1_0/suggestion',
    params: {
      q
    }
  })
}

/**
 * 获取搜索结果
 * @param {*} q 页码
 */
export const getSearch = (q) => axios({
  url: '/v1_0/search',
  params: {
    per_page: 10,
    q
  }
})
